#ifndef COLLECT_REFS_H
#define COLLECT_REFS_H
#include "rose.h"
#include "AnalyzeTraversal.h"

class CollectRefs : public AstPrePostProcessing {
    public:
        CollectRefs(analyzeTraversal *);
        void preOrderVisit(SgNode *node);
        void postOrderVisit(SgNode *node);
        void addReference(Reference *r);
        void replaceReference(Reference *r);
        void removeReference(Reference *r);
        Reference **getReferences() { return references; }
        int getNumReferences() { return n_references; }
        VariableWrapper *resolveVariable(SgVarRefExp *var);
        int canIgnore(SgNode *);
        int dontReset(SgNode *);
        void finish();
    private:
        SgExpression *last;
        analyzeTraversal *all;

        Reference *current_ref;

        Reference **references;
        int n_references;
};

#endif
